using System;
using System.Collections;
using FlowCanvas;
using FlowCanvas.Nodes;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
using Yoozoo.Core.Common;
using Yoozoo.Mars.Got;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class SwitchQualityLevel : FlowControlNode
    {
        protected override void RegisterPorts()
        {
            var casePerfect = AddFlowOutput("Perfect");
            var caseHigh = AddFlowOutput("High");
            var caseMiddle = AddFlowOutput("Middle");
            var caseLow = AddFlowOutput("Low");
            var caseVeryLow = AddFlowOutput("VeryLow");

            AddFlowInput("In", (f) =>
            {
                switch (QualityHelper.QualityMgr.CurrentQuality)
                {
                    case QualityEnum.Low:
                        f.Call(caseVeryLow);
                        break;
                    case QualityEnum.Medium:
                        f.Call(caseLow);
                        break;
                    case QualityEnum.High:
                        f.Call(caseMiddle);
                        break;
                    case QualityEnum.VeryHigh:
                        f.Call(caseHigh);
                        break;
                    case QualityEnum.Perfect:
                        f.Call(casePerfect);
                        break;
                }
            });
        }
    }
}